<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title></title>
	
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	
</head>
<body id="bodyid">
	<%
		String state = (String)request.getAttribute("state");
		String msg = "";
		
		if("10001".equals(state)) {
			msg = "您输入的用户或密码错误";
		}
	%>

	<div class="container">
	<% if("您输入的用户或密码错误".equals(msg)) {%>
		
	    <div id="msgerror" class="alert alert-error">
	    	<%=msg%>
	    </div>
	<%} %>    
	 
	
		<form class="well" id="enter" action="login.jspx" method="post">
		<label>用户名</label>
		<input type="text" class="span3" name="username" id="username">
		<label>密码</label>
		<input type="text" class="span3" name="password" id="password">
		<br/>
		
		<div id="msgcheck" class="alert alert-error"> 
	    </div>
		
		<button type="submit" class="btn">进入系统</button>
		</form>
	</div>	
	
	<script type="text/javascript">
	
		
		
		
		var username = document.getElementById("username");
		var password = document.getElementById("password");
		var msgcheck = document.getElementById("msgcheck");
		var msgerror = document.getElementById("msgerror");
		
		msgcheck.style.display="none";
		
	
		document.getElementById("enter").onsubmit=function() {
			if(username.value=="" || password.value=="") {
				msgcheck.style.display="block";
				msgcheck.innerHTML="用户名密码不能为空";
				return false;
			}
			
		}
		
		username.onfocus = function() {
			msgcheck.style.display="none";
			if(msgerror!=null && msgerror.innerHTML!="")
			msgerror.style.display="none";
			
		}
		
		password.onfocus = function() {
			
			msgcheck.style.display="none";
			if(msgerror!=null && msgerror.innerHTML!="") { 
				msgerror.style.display="none";
			}
		}
		
	</script>
	
	
	
</body>
</html>